function xmldoc(){
  var gwType="";
  form1.Attachment.PrepareData(); /*初始化，准备Http报文*/
  form1.Attachment.SetSessionID(sessionID);
  tXML.clearElement();
  tXML.createFormHeard("FieldFrm");
  tXML.CreateValueObject("FieldFrm","AppVO_Qsps_Map");
  tXML.CreateFieldResult("FieldFrm","AppVO_Qsps_Map","R1");
  tXML.appendField("FieldFrm","AppVO_Qsps_Map","R1","resourceID",resID);
  tXML.appendField("FieldFrm","AppVO_Qsps_Map","R1","createDate",document.form1.createDate.value);
  tXML.appendField("FieldFrm","AppVO_Qsps_Map","R1","title",document.form1.title.value);
  tXML.appendField("FieldFrm","AppVO_Qsps_Map","R1","content",document.form1.content.value);
  tXML.appendField("FieldFrm","AppVO_Qsps_Map","R1","flowCode",document.form1.flowCode.value);
  tXML.appendField("FieldFrm","AppVO_Qsps_Map","R1","isDelAttachAll",isDelAttachAll);

  tXML.CreateValueObject("FieldFrm","qsbm");
  reCount=0;
  for(var i=0;i<QSBM.getOrgCount();i++)
  {
    var tmpobj=QSBM.fndbyIndex(i);
    if(tmpobj!=null){
       tXML.CreateFieldResult("FieldFrm","qsbm","R"+reCount);
       tXML.appendField("FieldFrm","qsbm","R"+reCount,"qsbmOrgName",tmpobj.getOrgName());
       tXML.appendField("FieldFrm","qsbm","R"+reCount,"qsbmOrgType",tmpobj.getOrgType());
       tXML.appendField("FieldFrm","qsbm","R"+reCount,"qsbmOrgCode",tmpobj.getOrgCode());
       reCount++;
    }
  }

  tXML.CreateValueObject("FieldFrm","AppVO_Gw_Person");
  reCount=0
  for(var i=0;i<QSR.getOrgCount();i++)
  {
    var tmpobj=QSR.fndbyIndex(i);
    if(tmpobj!=null){
      tXML.CreateFieldResult("FieldFrm","AppVO_Gw_Person","R"+reCount);
      tXML.appendField("FieldFrm","AppVO_Gw_Person","R"+reCount,"qingshipersonName",tmpobj.getOrgName());
      tXML.appendField("FieldFrm","AppVO_Gw_Person","R"+reCount,"qingshipersonCode",tmpobj.getOrgCode());
      tXML.appendField("FieldFrm","AppVO_Gw_Person","R"+reCount,"qingshiOrgType",tmpobj.getOrgType());
      reCount++;
    }
  }
  
  tXML.CreateValueObject("FieldFrm","qsdx");
  reCount=0
  for(var i=0;i<QSDX.getOrgCount();i++)
  { 
    var tmpobj=QSDX.fndbyIndex(i);
    if(tmpobj!=null){
      tXML.CreateFieldResult("FieldFrm","qsdx","R"+reCount);
      tXML.appendField("FieldFrm","qsdx","R"+reCount,"qsdxName",tmpobj.getOrgName());
      tXML.appendField("FieldFrm","qsdx","R"+reCount,"qsdxCode",tmpobj.getOrgCode());
	  tXML.appendField("FieldFrm","qsdx","R"+reCount,"qsdxOrgType",tmpobj.getOrgType());
      reCount++;
    }
  }
 

  //-----------------------附件--------------------
  tXML.createFormHeard("attachmentFrm");
  tXML.CreateValueObject("attachmentFrm","attVO");
  reCount=0
  for(var i=0;i<attach.getAttachCount();i++)
  {
    var tmpobj=attach.fndbyIndex(i);
    if(tmpobj!=null){
      if(tmpobj.getStatusFlg()=="Y")   //如果是del attach
      {  
         tXML.CreateFieldResult("attachmentFrm","attVO","R"+reCount);
         tXML.appendField("attachmentFrm","attVO","R"+reCount,"action","del");
         tXML.appendField("attachmentFrm","attVO","R"+reCount,"attachID",tmpobj.getAttachID());
         tXML.appendField("attachmentFrm","attVO","R"+reCount,"FileName",tmpobj.getAttachID());
         tXML.appendField("attachmentFrm","attVO","R"+reCount,"ExtendName",tmpobj.getExtendName());
         reCount++;
      }
      else
      {
        if(tmpobj.getServer_fileFlg()=="N")   //是否要打包附件
        {  
           var fileValue="";
           tXML.CreateFieldResult("attachmentFrm","attVO","R"+reCount);
           tXML.appendField("attachmentFrm","attVO","R"+reCount,"action","add");
           tXML.appendField("attachmentFrm","attVO","R"+reCount,"attachID",tmpobj.getAttachID());
           tXML.appendField("attachmentFrm","attVO","R"+reCount,"FileName",tmpobj.getFileName());
           tXML.appendField("attachmentFrm","attVO","R"+reCount,"ExtendName",tmpobj.getExtendName());
           form1.Attachment.AppendAttachment(tmpobj.getURL(), "att"+reCount, 1);
           reCount++;
        }

      }

    }
  }
  var xmlHead="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
  form1.Attachment.AppendFieldData(xmlHead+tXML.showStr(), "xmlStr");
  var status=0;

  if(mode=="add")
  {
    status=form1.Attachment.postData(addAction, 'POST');
  }
  else
  {
    status=form1.Attachment.postData(editAction, 'POST');
  }

  tXML.resultDispose(status,form1.Attachment.GetResponseInfo());

  form1.Attachment.ClearData();   /*清除Http报文*/
  out.style.display="block";
}